package org.sunflower.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.reactive.function.BodyInserters;
import org.springframework.web.reactive.function.server.*;
import reactor.core.publisher.Mono;

/**
 * @description:
 * @author: TanJingyu
 * @create: 2021-11-25 14:02
 **/
@Configuration(proxyBeanMethods = false)
public class FilerConfiguration {

//    @Bean
//    public RouterFunction<ServerResponse> testFilter() {
//
//        HandlerFunction h = new HandlerFunction<>() {
//            @Override
//            public Mono handle(ServerRequest req) {
//                return ServerResponse.ok().body(BodyInserters.fromProducer("你好啊", String.class)).filter((request, next) -> {
//                    System.out.println("来了来了啊！");
//                    return next.handle(request);
//                });
//            }
//        };
//
//        return RouterFunctions.route(RequestPredicates.GET("/**"),
//                );
//
//        return (request, next) -> {
//            System.out.println("来了来了啊！");
//            return next.handle(request);
//        };
//    }
}

    